<?php
namespace app\serveradv\validate;
use app\manage\validate\BaseValidate;
/**
 * Created by PhpStorm.
 * User: 97606
 * Date: 2017/7/18
 * Time: 9:44
 */
class Adv extends BaseValidate
{
    protected $rule = [
        'id'           => ['number', 'gt'=>0],
        'c_id'         => ['number', 'gt'=>0],
        'name'         => ['length'=>'2,15'],
        'add_user_id'  => ['number', 'gt'=>0],
        'order'        => ['egt'=>0],
        'audit_status' => ['in'=>'-1,0,1'],
    ];

    protected $message = [

    ];

    protected $scene = [
        'addAdv'               => ['c_id', 'name', 'add_user_id', 'order'],
        'editAdv'              => ['id', 'c_id', 'name', 'add_user_id', 'order'],
        'deleteAdv'            => ['id'],
        'enableAdv'            => ['id'],
        'disableAdv'           => ['id'],
        'advAudit'             => ['id'],
        'advAuditFailure'      => ['id'],
        'advClassList'         => ['c_id'],
        'advDifferenceStatus'  => ['audit_status'],
        'advTimeLimit'         => ['c_id'],
    ];
}